﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QuestionsAnswers.UI.Models.QuestionsAnswers;

namespace QuestionsAnswers.UI.Models
{
    public class Answer
    {
        public int AnswerId { get; set; }
        public String Text { get; set; }
        public int AnswerRating { get; set; }

        public DateTime DateCreated
        {
            get
            {
                return (this.dateCreated == default(DateTime))
                           ? DateTime.Now
                           : this.dateCreated;
            }
            set { this.dateCreated = value; }
        }
        private DateTime dateCreated = default(DateTime);

        public int UserId { get; set; }
        public virtual User User { get; set; }

        public int QuestionId { get; set; }
        public virtual Question Question { get; set; }
        public List<Comment> Comments { get; set; }
   
    }
}
